#include <vector>
using namespace std;
int lengthOfLIS(vector<int> &nums) {
  int len = nums.size();
  int max_len = 1;
  vector<int> dp(len, 1);
  for (int i = 1; i < len; ++i) {
    for (int j = 0; j < i; ++j) {
      if (nums[j] < nums[i]) {
        dp[i] = max(dp[i], dp[j] + 1);
        max_len = max(max_len, dp[i]);
      }
    }
  }
  return max_len;
}